# 类是无法访问 实力属性的
# 尽管静态方法是可以访问类的，但是最好不要这样设计，否则设计成类方法岂不是更好

class Person:
    age = 0

    def shilifangfa(self):
        print(self)
        print(self.age)
        print(self.num)

    @staticmethod
    def jingtaifangfa():
        print(Person.age)

p = Person()
p.num = 10

print(Person.age)
print(p.age)


print(p.num)
# print(Person.num) 

#   File "C:\Users\wyl350\Desktop\demo-python\ÃæÏò¶ÔÏó\class.py", line 27, in <module>
#     print(Person.num) 
# AttributeError: type object 'Person' has no attribute 'num'

p.shilifangfa()
p.jingtaifangfa()
